//
//  MyCardTableViewCell.m
//  ICard
//
//  Created by fanshao on 11-2-27.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "MyCardTableViewCell.h"


@implementation MyCardTableViewCell
@synthesize usernameLabel;
@synthesize userPhoneLabel;

@synthesize myImageView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code.
		UILabel *tempTextfield = [[UILabel alloc] init];
		//[tempTextfield becomeFirstResponder];
		self.usernameLabel = tempTextfield;
		[tempTextfield release];
		[self.contentView addSubview:self.usernameLabel];
		
		UILabel *tempButton = [[UILabel alloc] init];
		self.userPhoneLabel = tempButton;
		[self.contentView addSubview:self.userPhoneLabel];
		
		myImageView = [[UIImageView alloc]init];
		[self.contentView addSubview:myImageView];
		[myImageView setImage:[UIImage imageNamed:@"im.png"]];
		
    }
    return self;
}

/*- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
 if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
 // Initialization code
 UITextField *tempTextfield = [[UITextField alloc] init];
 [tempTextfield becomeFirstResponder];
 self.primaryTextField = tempTextfield;
 [tempTextfield release];
 [self.contentView addSubview:self.primaryTextField];
 
 UIButton *tempButton = [UIButton buttonWithType:UIButtonTypeCustom];
 self.deleteButton = tempButton;
 [self.contentView addSubview:self.deleteButton];
 
 myImageView = [[UIImageView alloc]init];
 [self.contentView addSubview:myImageView];
 
 }
 return self;
 }*/
- (void)layoutSubviews {
	[super layoutSubviews];
	CGRect contentRect = self.contentView.bounds;
	CGFloat boundsX = contentRect.origin.x;
	CGRect frame;
	frame= CGRectMake(boundsX+0 ,0, 60, 60);
	[self.myImageView setImage:[UIImage imageNamed:@"nohead.png"]];
	self.myImageView.frame = frame;
	
	frame= CGRectMake(boundsX+60 ,20, 200,30);
	self.userPhoneLabel.frame = frame;
	
	frame= CGRectMake(boundsX+10 ,70, 60, 30);
	self.usernameLabel.frame = frame;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state.
}


- (void)dealloc {
    [super dealloc];
}


@end
